<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>登录</title>
    <meta name="Keywords" content=""/>
    <meta name="description" content="" />
    <script src="__ROOT__/static/home/css/userInfo/js/mui.min.js"></script>
    <link href="__ROOT__/static/home/css/userInfo/css/mui.min.css" rel="stylesheet"/>
    <link href="__ROOT__/static/home/css/login.css" rel="stylesheet"/>
    <link rel="stylesheet" href="__ROOT__/static/home/css/userInfo/css/style.css"/>
    <link href="__ROOT__/static/plugins/layer/skin/layer.css" rel="stylesheet" />
    <link href="__ROOT__/static/home/iconfont/style.css" rel="stylesheet" type="text/css" />
    <link href="__ROOT__/static/home/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
    <script src="__ROOT__/static/home/js/jquery-1.11.1.min.js"></script>
    <script src="__ROOT__/static/plugins/layer.mobile-v2.0/layer_mobile/layer.js"></script>
    <script src="__ROOT__/static/plugins/layer.mobile-v2.0/layer_mobile/need/layer.css"></script>
    <script>
            $(document).ready(function(){
                $("#weixin").click(function(){
                    layer.open({type: 2});
                    window.location.href="{:url('home/Login/getCode')}";
                })
            })
            $(document).ready(function(){
            $("#login").click(function(){
                var user ={};
                user.userName = $.trim($("#username").val());//获取用户名
                user.pwd = $.trim($("#password").val());
                $.ajax({
                    cache:true,
                    type:"POST",
                    url:"{:url('home/Login/userLogin')}",
                    dataTypes:"text",
                    data:user,
                    async:false,
                    success:function(data){

                        if(data==1){
                            layer.open({
                                content: '账号或密码未填写'
                                ,skin: 'msg'
                                ,time: 2 //2秒后自动关闭
                            });
                        }
                        if(data==2){
                            layer.open({
                                content: '账号或密码错误'
                                ,skin: 'msg'
                                ,time: 2 //2秒后自动关闭
                            });
                        }if(data==3){
                            layer.open({
                                type: 2
                                ,content:"<font color='#f0ffff'>登录中...</font>"
                                ,time:2
                            });
                            setTimeout("window.location.href='{:url('home/Index/index')}'",2000);
                        }
                    }
                })
            })
        })


    </script>
</head>
<body style="background: #efeff4;">
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">登录</h1>
</header>

<div class="mui-content">
    <div class="mui-input-group">
        <div class="mui-input-row">
            <label style="color:black">账号</label>
            <input id='username' type="text" name="username" class="mui-input-clear mui-input" placeholder="请输入账号" >
        </div>
        <div class="mui-input-row">
            <label style="color:black">密码</label>
            <input id='password' type="password" name="password" class="mui-input-clear mui-input" placeholder="请输入密码">
        </div>
    </div>
    <div class="mui-content-padded">
        <button id='login' class="mui-btn mui-btn-block mui-btn-primary" >登录</button>
        <div class="link-area"><a id='reg' href="{:url('home/Login/reg')}">注册账号</a><span class="spliter">
					|</span> <a id='forgetPassword' href="{:url('home/Login/back')}">忘记密码</a>
        </div>
    </div>
<div class="login-box">
    <div class="h20"></div>
    <div class="otherway">
        <div class="title"><span style="background:#EFEFF4">其他登录方式</span></div>
        <ul class="clearfix">
            <li>
                <a href="#" class="weibo"><i class="iconfont">&#xe60a;</i></a>
            </li>
            <li>
                <a href="#" class="qq"><i class="iconfont">&#xe607;</i></a>
            </li>
            <li>
                <a href="#" class="weixin" id="weixin"><i class="iconfont">&#xe606;</i></a>
            </li>
        </ul>
    </div>
</div>
</div>
</div>
</div>
</body>
</html>
